package com.usefullc.system.service.component.risk;

import com.usefullc.common.domain.BaseDomain;
import com.usefullc.common.enums.RiskCheckConditionResType;
import com.usefullc.common.util.JsonUtil;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: Sampson
 * @date: 2022-06-19 15:50
 */
@Data
public class RiskCheckCondition extends BaseDomain {

    private Integer timeSecond;

    private Integer count;

    /**
     * 处理方式 @see RiskCheckConditionResType
     */
    private Integer resType;


    public static void main(String[] args) {
        List<RiskCheckCondition> dataList = new ArrayList<>();
        RiskCheckCondition riskCheckCondition = new RiskCheckCondition();
        riskCheckCondition.setCount(2);
        riskCheckCondition.setTimeSecond(30);
        riskCheckCondition.setResType(RiskCheckConditionResType.REJECT.getCode());
        dataList.add(riskCheckCondition);
        riskCheckCondition = new RiskCheckCondition();
        riskCheckCondition.setCount(2);
        riskCheckCondition.setTimeSecond(60);
        riskCheckCondition.setResType(RiskCheckConditionResType.RANDOM_CODE.getCode());
        dataList.add(riskCheckCondition);

        String json = JsonUtil.list2Json(dataList);
        System.out.printf("json="+json);
    }
}
